<%--
 * edit.jsp
 *
 * Copyright (C) 2013 Universidad de Sevilla
 * 
 * The use of this project is hereby constrained to the conditions of the 
 * TDG Licence, a copy of which you may download from 
 * http://www.tdg-seville.info/License.html
 --%>

<%@page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>

<%@taglib prefix="jstl" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%>
<%@taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@taglib prefix="security"
	uri="http://www.springframework.org/security/tags"%>
<%@taglib prefix="display" uri="http://displaytag.sf.net"%>
<%@taglib prefix="acme" tagdir="/WEB-INF/tags"%>


<form:form action="${requestURI}" modelAttribute="auction">
	<form:hidden path="painting" />
	<form:hidden path="customer" />
 	<form:hidden path="id" />
	<form:hidden path="version"/>
	
		<jstl:if test="${isNew }">
		<acme:textbox code="auction.painting" path="painting.title" readonly="true" />
		<acme:textbox code="auction.startMoment" path="startMoment" />
		<acme:textbox code="auction.finishMoment" path="finishMoment" />
		<spring:message code="auction.startingPrice" />
		<acme:textbox code="auction.amount" path="startingPrice.amount" />
		<acme:textbox code="auction.currency" path="startingPrice.currency" />
		
		<acme:submit code="auction.create" name="save" />
		<acme:cancel code="auction.cancel" url="painting/customer/ownedList.do" />
		
		</jstl:if>
		<jstl:if test="${!isNew }">
		<acme:textbox code="auction.painting" path="painting.title" readonly="true" />
		<acme:textbox code="auction.startMoment" path="startMoment" readonly="true" />
		<acme:textbox code="auction.finishMoment" path="finishMoment" readonly="true"/>
		<spring:message code="auction.startingPrice" />
		<acme:textbox code="auction.amount" path="startingPrice.amount" readonly="true"/>
		<acme:textbox code="auction.currency" path="startingPrice.currency" readonly="true"/>
		
		<acme:cancel code="auction.goBack" url="auction/customer/activeAuctionsListByOther.do" />
		</jstl:if>
		<jstl:if test="${!isNew && !hasBid }">
		<acme:cancel code="auction.createBid"
				url="bid/customer/create.do?auctionId=${auctionId}" />
		</jstl:if>
	
		
		<jstl:if test="${!isNew && hasBid}">
		<acme:cancel code="auction.editBid"
				url="bid/customer/edit.do?bidId=${bidId}" />
		</jstl:if>
		
		
</form:form>